<template>
<div id="app">
    <el-tabs v-model="activeName" @tab-click="handleClick">
        <el-tab-pane label="参数配置" name="first"></el-tab-pane>
        <el-tab-pane label="通道数据" name="second"></el-tab-pane>
        <el-tab-pane label="数据查看" name="third"></el-tab-pane>
    </el-tabs>

    <router-view></router-view>
</div>
</template>

<style>
body,
html {

    font-family: Helvetica Neue, Helvetica, PingFang SC, Hiragino Sans GB, Microsoft YaHei, SimSun, sans-serif;
    font-weight: 400;
    /* -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent; */
}
</style>

<script>
// import MyHeader from './components/MyHeader.vue';
export default {
    name: "modbus-reader",

    data() {
        return {
            activeName: "first"
        };
    },
    methods: {
        handleClick(tab, event) {
            if (tab.name == "first") {
                this.$router.push("/");
                this.activeName = "first"
            } else if (tab.name == "second") {
                this.$router.push("/news");
                this.activeName = "second"
            } else if (tab.name == "third") {
                this.$router.push("/nedb");
                this.activeName = "third"
            } else {
                this.$router.push("/");
                this.activeName = "first"
            }
            // console.log(tab.name);
        }
    },
    created(){
        // this.activeName = "first"
        this.$router.push("/");
    }
};
</script>
